/*
 * @Author: your name
 * @Date: 2021-11-04 09:19:32
 * @LastEditTime: 2021-11-05 15:06:51
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /hr-pages/src/services/base.ts
 */
import { request } from '@ydc/workbench-tools';

export function rpcRequest(url: string, param: Record<string, any>, skipErrorHandler?: boolean) {
  return request(url, {
    method: 'post',
    data: {
      url,
      ...param,
    },
    skipErrorHandler,
  });
}

export function officeGetRequest(url: string, param: Record<string, any>, skipErrorHandler?: boolean) {
  return request(`/${url}`, {
    method: 'get',
    params: {
      ...param,
    },
    skipErrorHandler,
  });
}

export function rpcGetRequest(url: string, param: Record<string, any>, skipErrorHandler?: boolean) {
  return request(`/gateway/${url}`, {
    method: 'get',
    params: {
      ...param,
    },
    skipErrorHandler,
  });
}
